=================================================================================== 6b. Fe\ :sup:`3+`\ /Fe\ :sub:`T` to *f*\ \ :sub:`O2` dependence =================================================================================== To add a new parameterisation for Fe\ :sup:`3+`\ /Fe\ :sub:`T` to *f*\ \ :sub:`O2` dependence involves creating a new “terms” function, which details how any parameters depend on pressure, temperature, melt composition, etc. Here is an example for Borisov et al. (2018) in ``model_dependent_variables.py``: .. code-block:: python def FefO2_Borisov18_terms( PT, melt_wf, models=default_models ): # Eq. (4) from Borisov et al. (2018) CMP 173:98 doi:10.1007/s00410-018-1524-8 T_K = PT["T"] + 273.15 # Borisov et al. (2018) CMP 173 a = 0.207 # melt mole fraction with no volatiles and all Fe as FeOT melt_comp = mg.melt_mole_fraction( melt_wf, models, "no", "no", molmass="ONeill22", majors="ONeill22" ) B = ( 4633.3 / T_K - 0.445 * melt_comp["SiO2"] - 0.900 * melt_comp["TiO2"] + 1.532 * melt_comp["MgO"] + 0.314 * melt_comp["CaO"] + 2.030 * melt_comp["Na2O"] + 3.355 * melt_comp["K2O"] - 4.851 * melt_comp["P2O5"] - 3.081 * melt_comp["SiO2"] * melt_comp["Al2O3"] - 4.370 * melt_comp["SiO2"] * melt_comp["MgO"] - 1.852 ) return a, B Then, the new parameterisation must be added to the functions ``fO22Fe3FeT()`` and ``f_O2()`` in ``model_dependent_variables.py``, which is shown here for Borisov et al. (2018): .. code-block:: python def fO22Fe3FeT(fO2, PT, melt_wf, models=default_models): # converting fO2 to Fe3/FeT model = models.loc["fO2", "option"] # Eq. (4) from Borisov et al. (2018) CMP 173:98 doi:10.1007/s00410-018-1524-8 if model == "Borisov18": a, B = FefO2_Borisov18_terms(PT, melt_wf, models) Fe3Fe2 = 10.0 ** (a * math.log10(fO2) + B) return Fe3Fe2 / (Fe3Fe2 + 1.0) def f_O2(PT, melt_wf, models=default_models): model = models.loc["fO2", "option"] # Eq. (4) from Borisov et al. (2018) CMP 173:98 doi:10.1007/s00410-018-1524-8 elif model == "Borisov18": F = mg.Fe3Fe2(melt_wf) a, B = FefO2_Borisov18_terms(PT, melt_wf, models) fO2 = 10.0 ** ((math.log10(F) - B) / a) return fO2 To use it, the "fO2" option in "models" would be set to "Borisov18".